package com.lzw.breezeNovel.webApp.controller.novel;

import com.lzw.breezeNovel.common.result.Result;
import com.lzw.breezeNovel.webApp.service.novel.ChapterService;
import com.lzw.breezeNovel.webApp.vo.novel.BookVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;



/**
 * @author 清风明月
 * @Package com.lzw.breezeNovel.webApp.controller
 * @date 2025/3/2
 * @description 章节的控制类
 */
@RestController
@RequestMapping("/app/chapter")
@SuppressWarnings("all")
public class ChapterController {

    /**
     * 注入章节服务类
     */
    @Autowired
    private ChapterService chapterService;

    /**
     * 根据小说id获取所有的章节
     */
    @RequestMapping("/getChaptersByBookId")
    public Result<BookVo> getChaptersByBookId(Long bookId){
        BookVo bookVos = chapterService.getChaptersByBookId(bookId);
        return Result.ok(bookVos);
    }

}
